<%@page import="entity.UserAddress"%>
<%@page import="service.UserAddressService"%>
<%@page import="entity.Order"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" href="<%=basePath%>css/bootstrap.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="<%=basePath%>css/MyOrder.css"/>
</head>
<body>
<%
	Order order=(Order)request.getAttribute("order");
	UserAddressService userAddressService=new UserAddressService();
	UserAddress userAddress=userAddressService.getUserAddressById(order.getUserId());
	%>
	<div class="desciptioncss">
	<div class="o_content">
    	
    		<table id="goodlist" class="table table-striped" >
    			<tr>
    			<td colspan="4">收货地址</td>
				<td colspan="4"><%=userAddress.getDetailAddress() %></td>
				</tr>
    			<tr class="tr1">
				<th>下单时间</th>
				<th>订单号</th>
				<th>商品名字</th>
				<th>商品详情</th>
				<th>商品价格</th>
				<th>商品数量</th>
				<th>商品总价</th>
				<th>订单状态</th>
			</tr>
		
    			<%
    				for(int i=0; i<order.getOrderItem().size(); i++) {
    			%>
    			<tr>
    				<td><%=order.startTimeFormat() %></td>
    				<td><%=order.getOrderId() %></td>
    				<td>
    					<a href="becomeBusiness.jsp"><%=order.getOrderItem().get(i).getGoods().getGoodName() %></a></td>
    				<td><a href="becomeBusiness.jsp"><%=order.getOrderItem().get(i).getGoods().getGoodInfo() %></a></td>
    				<td><%=order.getOrderItem().get(i).getGoods().getGoodPrice() %></td>
    				<td><%=order.getOrderItem().get(i).getGoodNumber() %></td>
    				<td><%=order.getOrderItem().get(i).getTotal_price() %></td>
    				<td><%=order.getOrderStatus() %></td>
    			</tr>
    			<%} %>
 
				<tr>
				<td colspan="2">手机</td>
				<td colspan="2"><%=userAddress.getContactPhone() %></td>
				<td colspan="2">收货人</td>
				<td colspan="2"><%=userAddress.getUserId() %></td>
				</tr>
    		</table>
    	</div>
    	</div>
    	<script type="text/javascript" src="<%=basePath%>/js/jquery-3.2.1.min.js" ></script>
    	<script type="text/javascript" src="<%=basePath%>/lib/layer/2.4/layer.js"></script>
    	
</body>
</html>